/*
===========================================================================
This source file is part of DyLab (Dynamic Laboratory)
For the latest info, see http://dylab.googlecode.com

Copyright (c) 2006-2008 Lukas Krejci
(krejci.lukas@volny.cz)

This file is part of DyLab.

    DyLab is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    DyLab is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with DyLab.  If not, see <http://www.gnu.org/licenses/>.
===========================================================================
*/

#ifndef __dylab_ComInput_h__
#define __dylab_ComInput_h__

//===========================================================================================
#include <dylab/utils/components/ComponentBase.h>
#include <dylab/simulation/ISimulationComponent.h>
#include <dylab/simulation/EventDispatcher.h>

//===========================================================================================
namespace dylab {

   
    /** Simulation input component type.
	@remarks
		This class defines an interface for the simulation input component type.
		Components of this type are responsible for implementing the requested input driver.
    */
    class DYLAB_EXPORT ComInput 
        : public ISimulationComponent
        , public ComponentBase<ComInput>
    {
    public:
        class DYLAB_EXPORT EventDispatcher
            : public dylab::EventDispatcher<InputEvent>
        {
        };
        //-----------------------------------------------------------------------------

    public:

        ComInput(const String & _componentName);
        virtual ~ComInput();

        /** Input component should store the main application window's extents defining mouse region. 
		@remarks
			If the main window changes its size, then it this method should be called to reflect the changes.
		@param[in] _width
			The width of the main application window.
		@param[in] _height
			The height of the main application window.
        */
        virtual void setWindowExtents(uint32_t _width, uint32_t _height) = 0;

        /** Input component should capture the state from common input devices.
		@remarks
			All state changes should be reflected by correspodning the event messages.
        */
        virtual void capture() = 0;
    };
}
//===========================================================================================
#endif // __dylab_ComInput_h__
